package Main

import org.apache.http.client.HttpClient
import org.apache.http.impl.client.DefaultHttpClient
import org.apache.http.client.methods.HttpGet
import java.net.URLEncoder
import org.apache.http.util.EntityUtils

object Main2 {

  def main(args: Array[String]) {

    val client = new DefaultHttpClient

    var content = "中文"
    var url = "http://3g.wuxi.gov.cn/contentsearch/getJson?jsonpCallback=?&query=" + URLEncoder.encode(content) + "&sitename=site_1374209144805&countperpage=5&pagenum=1"
    val get = new HttpGet(url)
    //get.setHeader("Content-Type", "text/html;charset=gb2312")
    val response = client.execute(get)
    val result = EntityUtils.toString(response.getEntity(), "gb2312")
    println(result)
  }

}

